﻿using System;
using System.Collections.Generic;
using System.Text;

using XRpgLibrary.ScriptClasses;
using XRpgLibrary.CharacterClasses;

using Microsoft.Xna.Framework;

namespace XRpgLibrary.Scripts.Global
{
    public class AttachScript : GameScript
    {
        private GameScript script;

        public AttachScript(GameScript script)
        {
            this.script = script;
        }

        public override void Execute(Character self, object trigger, ScriptContext context, GameTime gameTime)
        {
            if (script != null)
                self.AddScriptEvent(script.EventName, script);
            
            self.RemoveScriptEvent(this.EventName, this.ScriptName);
        }
    }
}
